package yunhe.servlet;

import yunhe.biz.impl.StockMgrBizImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Administrator on 2017/6/20.
 */
@WebServlet(name = "SetInvLimitServlet",urlPatterns = "/SetInvLimitServlet")
public class SetInvLimitServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String sto=request.getParameter("sto");
        String topNum=request.getParameter("topNum");
        String buttNum=request.getParameter("buttNum");
        String proBarCode=request.getParameter("proBarCode");
        int re=new StockMgrBizImpl().setInvLimit(sto,proBarCode,topNum,buttNum);
        if(re>0){
            response.getWriter().print("true");
        }
        else{
            response.getWriter().print("false");
        }

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
